﻿using System;
using System.Collections.Generic;
using System.Text;

namespace WordsReminder
{
    struct WordEntry
    {
        public static readonly WordEntry Empty = new WordEntry("", "");

        public string Word;
        public string Meaning;

        public WordEntry(string word, string meaning)
        {
            Word = word;
            Meaning = meaning;
        }
    }

    class WordEntryCollection : List<WordEntry>
    {
        public bool Contains(string word, bool ignoreCase)
        {
            foreach (WordEntry item in this)
            {
                if (string.Compare(item.Word, word, ignoreCase) == 0)
                    return true;
            }
            return false;
        }

        public WordEntry Add(string word, string meaning)
        {
            WordEntry n = new WordEntry(word, meaning);
            base.Add(n);
            return n;
        }
    }
}
